package de.hsw.facebook.model.rowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import de.hsw.facbook.model.entities.Account;

public class AccountRowMapper {
	private Log logger = LogFactory.getLog(GroupRowMapper.class);
	
	public Account mapRow(ResultSet rs) throws SQLException{
		logger.debug("-> entering mapRow");
		Account account = new Account();
		
		account.setID(rs.getInt("accountID"));
		account.setEmail(rs.getString("email"));
		account.setPassword(rs.getString("password"));
		account.setSurname(rs.getString("surname"));
		account.setLastname(rs.getString("lastname"));
		account.setBirthday(rs.getDate("birthday"));
		account.setCity(rs.getString("city"));
		account.setCountry(rs.getString("country"));
		account.setGender(rs.getString("gender"));
		
		return account;
	}

}
